﻿#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>
using namespace std;



class Worker
{
public:
	Worker() = default;

	Worker(const char* name, int x)
	{
		_name.clear();
		_name += name;
		_salary = x;
	}


	void introduce()
	{
		cout << _name << endl << endl;
	}

protected:
	void AcceptSalary()
	{
		cout << _salary << endl << endl;
	}

private:
	string _name;
	int _salary = 0;
};

class HR : public  Worker
{
public:
	void test()
	{
		cout << "fairly test" << endl;
	}
};

//class Boss : protected Worker
//{
//public:
//	void Power()
//	{
//		cout << "Boss" << endl;
//	}
//};

//protected和privarte的继承只能在子类中调用父类的public
//父类的private类子无法使用
// protected能在子类中使用
class Boss : private  Worker
{
public:
	void Power()
	{
		cout << "Boss" << endl;
		//introduce();
		AcceptSalary();
	}
};

int main()
{
	Boss boos;
	boos.Power();

	return 0;
}


//int main()
//{
//
//	return 0;
//}